/**
 * 
 */
package com.xbang.attendance.entity.system;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;

import com.xbang.core.config.Note;

/**
 * @author dev.zhang 维修站
 */
@Entity
public class MaintenanceStation implements Serializable {

	private static final long serialVersionUID = -8968178332378929135L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;

	/** 编码 */
	@Note(value = "维修站编码")
	private String number;

	/** 简称 */
	@Note(value = "维修站名称")
	private String name;

	/** 全称 */
	private String fullName;

	/** 地址 */
	private String address;

	/** 联系人 */
	private String contact;

	/** 电话 */
	private String telephone;

	private String email;

	private String description;

	@OneToOne()
	@JoinColumn(name = "region", referencedColumnName = "id")
	private Region region;

	@OneToOne()
	@JoinColumn(name = "mainWarehouse", referencedColumnName = "id")
	private Warehouse mainWarehouse;

	@ManyToMany(targetEntity = Warehouse.class, fetch = FetchType.EAGER)
	@JoinTable(name = "maintenance_warehouse", joinColumns = @JoinColumn(name = "maintenance_id"), inverseJoinColumns = @JoinColumn(name = "warehouse_id"))
	private Set<Warehouse> warehouse;

	/** 传真 */
	private String fax;

	public boolean isSelectWarehouse(Integer houseId) {
		//

		return true;
	}

	/**
	 * @return the number
	 */
	public String getNumber() {
		return number;
	}

	/**
	 * @param number
	 *            the number to set
	 */
	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @param address
	 *            the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @return the contact
	 */
	public String getContact() {
		return contact;
	}

	/**
	 * @param contact
	 *            the contact to set
	 */
	public void setContact(String contact) {
		this.contact = contact;
	}

	/**
	 * @return the telephon
	 */
	public String getTelephone() {
		return telephone;
	}

	/**
	 * @param telephon
	 *            the telephon to set
	 */
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	/**
	 * @return the fax
	 */
	public String getFax() {
		return fax;
	}

	/**
	 * @param fax
	 *            the fax to set
	 */
	public void setFax(String fax) {
		this.fax = fax;
	}

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the region
	 */
	public Region getRegion() {
		return region;
	}

	/**
	 * @param region
	 *            the region to set
	 */
	public void setRegion(Region region) {
		this.region = region;
	}

	/**
	 * @return the mainWarehouse
	 */
	public Warehouse getMainWarehouse() {
		return mainWarehouse;
	}

	/**
	 * @param mainWarehouse
	 *            the mainWarehouse to set
	 */
	public void setMainWarehouse(Warehouse mainWarehouse) {
		this.mainWarehouse = mainWarehouse;
	}

	/**
	 * @return the warehouse
	 */
	public Set<Warehouse> getWarehouse() {
		return warehouse;
	}

	/**
	 * @param warehouse
	 *            the warehouse to set
	 */
	public void setWarehouse(Set<Warehouse> warehouse) {
		this.warehouse = warehouse;
	}

	/**
	 * @return the fullName
	 */
	public String getFullName() {
		return fullName;
	}

	/**
	 * @param fullName
	 *            the fullName to set
	 */
	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

}
